package Extended;

import java.awt.*;
import java.awt.datatransfer.*;


public class ImageTransferable implements Transferable
{
	private Image TheImage;

	public ImageTransferable(Image ThisImage)
	{
		TheImage = ThisImage;
	}
 
	public DataFlavor[] getTransferDataFlavors()
	{
		return new DataFlavor[]
		{
			DataFlavor.imageFlavor
		};
	}
 
	public boolean isDataFlavorSupported(DataFlavor flavor)
	{
		return flavor.equals(DataFlavor.imageFlavor);
	}
 
	public Object getTransferData(DataFlavor flavor)
	{
		if(flavor.equals(DataFlavor.imageFlavor))
		{
			return TheImage;
		}
		else
		{
			return null;
		}
	}
}
